def get_path_of_leaf(index, total_leaves):
    layers = total_leaves.bit_length() - 1
    binary_path = bin(index)[2:]
    binary_path = binary_path.zfill(layers)
    path = ['L' if bit == '0' else 'R' for bit in binary_path]
    return path


path_of_leaf_413 = get_path_of_leaf(413, 512)
print(path_of_leaf_413)
